package prac_aca;

public class CalculatorPrac {

	int[] str2;
	float sum = 0;
	float average;
	int maxNum=0;
	int minNum=0;

	public CalculatorPrac(int[] str) {

		str2 = str;

	}

	public float hap() {
		for (int i = 0; i < str2.length; i++) {

			sum += str2[i];

		}
		return sum;
	}

	public float avg() {
		sum = 0;
		hap();
		average = sum / str2.length;
		return average;
	}
	
	public int max(){
		maxNum=str2[0];
		for(int i=0; i<str2.length; i++){
			if(maxNum<str2[i]){
				maxNum=str2[i];
			}
		}
		return maxNum;
	}
	
	public int min(){
		minNum=str2[0];
		for(int i=0; i<str2.length; i++){
			if(minNum>str2[i]){
				minNum=str2[i];
			}
		}
		return minNum;
	}

}
